<?php

class Eleven_Resource_User extends CMS_Model_Resource_Db_Table_Abstract 
{
	protected $_name = 'user';
	protected $_primary = 'userId';
	protected $_rowClass = 'Eleven_Resource_User_Item';
	
	public function getUserById($id)
	{
		return $this->find($id)->current();
	}
	
    public function getUserByUsername($username)
    {
        $select = $this->select();
        $select->where('username = ?', $username);

        return $this->fetchRow($select);
    }
}

?>